package com.song.ssm.controller;

import com.song.ssm.mapper.RoomMapper;
import com.song.ssm.pojo.Room;
import com.song.ssm.service.RoomService;
import com.song.ssm.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author TonySong
 * @date 2025/8/18 0018
 * @time 13:44
 */
@RestController
@RequestMapping("/room")
public class RoomController {
    @Autowired
    private RoomService roomService;

    @GetMapping("/rooms")
    public Result getRooms(){
        List<Room> list=roomService.findAll();
        return new Result(200,"success",true,list);
    }
}
